'use strict';
const {
    Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
    class OrderAddress extends Model {
        /**
         * Helper method for defining associations.
         * This method is not a part of Sequelize lifecycle.
         * The `models/index` file will call this method automatically.
         */
        static associate(models) {
            // define association here
            models.OrderAddress.belongsTo(models.Order, {as: 'order'})
        }
    };
    OrderAddress.init({
        orderId: DataTypes.INTEGER,
        province: DataTypes.STRING,
        city: DataTypes.STRING,
        area: DataTypes.STRING,
        detail: DataTypes.STRING,
        tel: DataTypes.STRING,
        name: DataTypes.STRING
    }, {
        sequelize,
        modelName: 'OrderAddress',
    });
    return OrderAddress;
};
